# -*- Makefile -*-
#
# Makefile for Kenni's fantastic code
#

## Execute "make" if making production run. Or "make debug=1" for debugging run.
##
## debug = 0: optimized build; 1: debugging build
## coverage = 1: enable code coverage analysis (used for debugging)
## gprof = 1: enable profiling (used for tuning optimization)

debug = 0

## Select C compiler
CC = icc

########################################################################
## Select compiler and linker flags
## (Usually you won't need to modify anything below)
########################################################################

CFLAGS = -g
ifeq ($(debug), 0)
	CFLAGS += -fast
else
	CFLAGS += -debug full -BC
endif

##

LDFLAGS = -L/home/echoi/opt/intel/inspector_xe_2011/lib64/pinruntime

# source code without preprocessor directives
#C_SRCS = src/2dpic.c
C_SRCS = src_dilationalPlasticity/2dpic.c

C_OBJS = $(C_SRCS:.c=.o)

EXE = cohesion


## Action

all: $(EXE)

$(EXE): $(C_OBJS)
	$(CC) $(LDFLAGS) $(C_OBJS) -o $@

$(C_OBJS): %.o : %.c
	$(CC) $(CFLAGS) -c $< -o $@

clean:
	rm -f $(C_OBJS) $(EXE)
